
import request from '@/utils/request'

export function getList(params) {
    return request({
        url: '/marketing/weekPrize/listPage',
        headers: {
        'Content-Type': 'application/json;charset=UTF-8',
        'pageNum': params.pageNum,
        'pageSize': params.pageSize
        },
        method: 'get',
        params:params
    })
}

export function getListDetails(params) {
    return request({
        url: '/marketing/weekPrizeProInfoRef/listPage?weekPrizeId='+params.id,
        headers: {
        'Content-Type': 'application/json;charset=UTF-8',
        'pageNum': params.pageNum,
        'pageSize': params.pageSize
        },
        method: 'get',
        params:params
    })
}
export function getDetails(params) {
    return request({
        url: '/marketing/weekPrizeProInfoRef/listPage?weekPrizeId='+params.id,
        headers: {
        'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'get',
    })
}
export function getListPrize(params) {
    return request({
        url: '/marketing/weekPrizeUsers/listPage',
        headers: {
        'Content-Type': 'application/json;charset=UTF-8',
        'pageNum': params.pageNum,
        'pageSize': params.pageSize
        },
        method: 'get',
        params:params
    })
}

export function change(params) {
    return request({
        url: '/marketing/weekPrizeUsers/select?id='+params.id,
        headers: {
        'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'POST',
    })
}
export function delProinfo(params) {
    return request({
        url: '/marketing/weekPrizeProInfoRef',
        headers: {
        'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'delete',
        data:params
    })
}

export function isAdd(data) {
    return request({
        url: '/marketing/weekPrizeProInfoRef',
        headers: {
        'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'post',
        data
    })
}

export function updateGoods(data) {
    return request({
        url: '/marketing/weekPrizeProInfoRef',
        headers: {
        'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'put',
        data
    })
}
//周周奖配置

export function settings(data) {
    return request({
        url: '/marketing/weekPrize',
        headers: {
        'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'put',
        data
    })
}
//新增活动
export function createData(data) {
    return request({
        url: '/marketing/weekPrize',
        headers: {
        'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'post',
        data
    })
}
//修改中奖状态
export function changeReceiveState(data) {
    return request({
        url: '/marketing/weekPrizeUsers/changeReceiveState/'+data.id+'?isReceive='+data.status,
        headers: {
        'Content-Type': 'application/json;charset=UTF-8',
        },
        method: 'post',
    })
}